<!--
/*********************************************************************************
 * SugarCRM is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/

/*********************************************************************************

 ********************************************************************************/
-->
<!-- BEGIN: main -->
<script type="text/javascript" src="modules/Emails/javascript/Email.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" language="Javascript">
{JS_VARS}
</script>
<form action="index.php" method="POST" name="DetailView" id="form">
	<input type="hidden" name="module" value="Emails">
	<input type="hidden" name="record" value="{ID}">
	<input type="hidden" name="isDuplicate" value=false>
	<input type="hidden" name="action">
	<input type="hidden" name="contact_id" value="{CONTACT_ID}">
	<input type="hidden" name="user_id" value="{USER_ID}">
	<input type="hidden" name="return_module">
	<input type="hidden" name="return_action">
	<input type="hidden" name="return_id">
	<input type="hidden" name="type" value="out">
	<input type="hidden" name="assigned_user_id">
	<input type="hidden" name="parent_id" value="{PARENT_ID}">
	<input type="hidden" name="parent_type" value="{PARENT_TYPE_UNTRANSLATE}">
	<input type="hidden" name="parent_name" value="{PARENT_NAME}">
	<input type="hidden" name="inbound_email_id" value="{ID}">
	<input type="hidden" name="email_name" value="{EMAIL_NAME}">
	<input type="hidden" name="to_email_addrs" value="{FROM}">

<table width="10%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td style="padding-bottom: 2px;" align="left" width="5%">
			<input title="{MOD.LBL_BUTTON_FORWARD}"
					accessKey="{MOD.LBL_BUTTON_FORWARD_KEY}"
					class="button" onclick="this.form.return_module.value='{RETURN_MODULE}';
											this.form.return_action.value='{RETURN_ACTION}';
											this.form.return_id.value='{ID}';
											this.form.action.value='EditView';
											this.form.type.value='forward'"
					type="submit" name="button"
					value="  {MOD.LBL_BUTTON_FORWARD}  "
					style="display:{DISABLE_FORWARD_BUTTON};"
			>
		</td>
		<td>&nbsp;</td>
		<td style="padding-bottom: 2px;" align="left" width="5%">
			<input title="{MOD.LBL_BUTTON_REPLY_TITLE}"
					accessKey="{MOD.LBL_BUTTON_REPLY_KEY}"
					class="button" onclick="this.form.return_module.value='{RETURN_MODULE}';
											this.form.return_action.value='{RETURN_ACTION}';
											this.form.return_id.value='{ID}';
											this.form.action.value='EditView'"
					type="submit" name="button"
					value="  {MOD.LBL_BUTTON_REPLY}  "
					style="display:{DISABLE_REPLY_BUTTON};"
			>
		</td>
		<td>&nbsp;</td>
		<td style="padding-bottom: 2px;" align="left" width="5%">
			<input title="{APP.LBL_DELETE_BUTTON_TITLE}"
					accessKey="{APP.LBL_DELETE_BUTTON_KEY}"
					class="button" onclick="this.form.return_module.value='{DELETE_RETURN_MODULE}';
											this.form.return_action.value='{DELETE_RETURN_ACTION}';
											this.form.return_id.value='{DELETE_RETURN_ID}';
											this.form.type.value='{DELETE_RETURN_TYPE}';
											this.form.assigned_user_id.value='{DELETE_RETURN_ASSIGNED_USER_ID}';
											this.form.action.value='Delete';
											return confirm('{APP.NTC_DELETE_CONFIRMATION}')"
					type="submit" name="button"
					value="    {APP.LBL_DELETE_BUTTON}    "
			>
		</td>
		<td>&nbsp;</td>
		<td style="padding-bottom: 2px;" align="left" width="5%">
			<input type="button" name="button" class="button"
				style="display:{DISABLE_RAW_BUTTON};"
				id="rawButton"
				title="{MOD.LBL_BUTTON_RAW_TITLE}"
				accesskey="{MOD.LBL_BUTTON_RAW_KEY}"
				value=" {MOD.LBL_BUTTON_RAW_LABEL} "
				onclick="open_popup('Emails', 800, 600, '', true, true, '', 'show_raw', '', '{RAW_METADATA}');"
			/>
		</td>
		<td align='right'>{ADMIN_EDIT}</td>
	</tr>
</table>
</form>

<div class="detail view">
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0">
	{PAGINATION}
	<tr>
		<td width="15%" scope="row"><slot>{APP.LBL_ASSIGNED_TO}</slot></td>
		<td width="35%" valign="top"><slot>{ASSIGNED_TO}</slot></td>
		<td width="15%" scope="row"><slot>{MOD.LBL_DATE_SENT}</slot></td>
		<td width="35%" colspan="3"><slot>{DATE_START} {TIME_START}</slot></td>
	</tr>
	<tr>
		<!-- BEGIN: open_source -->
		<td scope="row"><slot>&nbsp;</slot></td>
		<td><slot>&nbsp;</slot></td>
		<!-- END: open_source -->
		<td scope="row"><slot>{PARENT_TYPE}</slot></td>
		<td><slot>{PARENT_NAME}</slot></td>
	</tr>
	<tr>
       <td scope="row"><slot>{MOD.LBL_FROM}</slot></td>
        <td colspan=3><slot>{FROM}&nbsp;</slot></td>
	</tr>
	<tr>
       <td scope="row"><slot>{MOD.LBL_TO}</slot></td>
        <td colspan='3'><slot>{TO}&nbsp;</slot></td>
	</tr>
	<tr>
		<td scope="row"><slot>{MOD.LBL_CC}</slot></td>
		<td colspan='3'><slot>{CC}&nbsp;</slot></td>
	</tr>
	<tr>
		<td scope="row"><slot>{MOD.LBL_BCC}</slot></td>
		<td colspan='3'><slot>{BCC}&nbsp;</slot></td>
	</tr>
	<tr>
		<td scope="row"><slot>{MOD.LBL_SUBJECT}</slot></td>
		<td colspan='3'><slot>{NAME}&nbsp;</slot></td>
	</tr>
	<tr>
		<td scope="row" valign="top"><slot>{MOD.LBL_BODY}</slot></td>
		<td colspan="3"  style="background-color: #ffffff; color: #000000" ><slot>
			<div id="html_div" style="background-color: #ffffff;padding: 5px">{DESCRIPTION_HTML}</div>
			<input id='toggle_textarea_elem' onclick="toggle_textarea();" type="checkbox" name="toggle_html"/> <label for='toggle_textarea_elem'>{MOD.LBL_SHOW_ALT_TEXT}</label><br>
			<div id="text_div" style="display: none;background-color: #ffffff;padding: 5px">{DESCRIPTION}</div>
			<script type="text/javascript" language="Javascript">
				var plainOnly = {SHOW_PLAINTEXT};
				if(plainOnly == true) {
					document.getElementById("toggle_textarea_elem").checked = true;
					toggle_textarea();
				}
			</script>
		</td>
	</tr>
	<tr>
		<td scope="row" valign="top"><slot>{MOD.LBL_ATTACHMENTS}</slot></td>
		<td colspan="3"><slot>{ATTACHMENTS}</slot></td>
	</tr>
</table>
</div>
<!-- END: main -->
